<page-header title="关注产品" [breadcrumb]="breadcrumb">
    <ng-template #breadcrumb>
        <ql-breadcrumb>
            <ql-breadcrumb-item>产品管理</ql-breadcrumb-item>
            <ql-breadcrumb-item>关注产品</ql-breadcrumb-item>
        </ql-breadcrumb>
    </ng-template>
</page-header>

<page-container>
    <data-form label-width="100px" (submit)="onRefresh()">
        <ql-form-item label="产品名称">
            <ql-input [(ngModel)]="productname"></ql-input>
        </ql-form-item>
        <ql-form-item label="产品代码">
            <ql-input [(ngModel)]="productcode"></ql-input>
        </ql-form-item>
        <ql-form-item label="产品类别">
            <ql-select [(ngModel)]="productcategory">
              <ql-option *ngFor="let item of dictService.getDict('product_category')" [label]="item.paramLabel" [value]="item.paramValue"></ql-option>

              <!--<ql-option *ngFor="let item of productType" [label]="item.label" [value]="item.value"> </ql-option>-->
            </ql-select>
        </ql-form-item>
        <ql-form-item label="推荐类别">
            <ql-select [(ngModel)]="recommandtype">
              <ql-option *ngFor="let item of dictService.getDict('recommand_type')" [label]="item.paramLabel" [value]="item.paramValue"></ql-option>

              <!--<ql-option *ngFor="let item of []" [label]="item.label" [value]="item.value"> </ql-option>-->
            </ql-select>
        </ql-form-item>
    </data-form>
    <data-table [model]="attentionList" [cursor]="cursorService"
                (cursor-change)="onRefresh()">
        <ql-table-column model-key="productname" label="产品名称"></ql-table-column>
        <ql-table-column model-key="productcode" label="产品代码"></ql-table-column>
        <ql-table-column model-key="productcategory" label="产品类别">
          <ng-template #slot let-scope="scope">
            {{scope.rowData.productcategory | dict:'product_category'}}
          </ng-template>
        </ql-table-column>
        <ql-table-column model-key="risklevel" label="风险等级">
          <ng-template #slot let-scope="scope">
            {{scope.rowData.risklevel | dict:'risk_level'}}
          </ng-template>
        </ql-table-column>
        <ql-table-column model-key="recommandtype" label="推荐类别">
          <ng-template #slot let-scope="scope">
            {{scope.rowData.recommandtype | dict:'recommand_type'}}
          </ng-template>
        </ql-table-column>
        <ql-table-column model-key="expiredate" label="停售时间"></ql-table-column>
        <ql-table-column model-key="productprofit" label="产品利率"></ql-table-column>
        <ql-table-column label="操作" width="250px">
            <ng-template #slot let-scope="scope">
                <ql-button type="text" (click)="delFun(scope.rowData.productcode)">移除</ql-button>
                <!--<ql-button type="text">置顶</ql-button>-->
                <!--<ql-button type="text">分享</ql-button>-->
                <ql-button type="text" [routerLink]="['/product/product-detail', { id: scope.rowData.productcode }]">查看详情</ql-button>
            </ng-template>
        </ql-table-column>
    </data-table>
</page-container>
